"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PointClass = void 0;
var PointClass = (function () {
    function PointClass(_x, _y) {
        var _this = this;
        this._x = _x;
        this._y = _y;
        this.drawPoint = function () {
            console.log("x: ", _this._x, "y: ", _this._y);
        };
        this.getDistances = function (p) {
            return Math.pow(p.X - _this._x, 2) + Math.pow(p.Y - _this._y, 2);
        };
    }
    Object.defineProperty(PointClass.prototype, "X", {
        get: function () {
            return this._x;
        },
        set: function (value) {
            if (value < 0) {
                throw new Error("x的value不能小于0");
            }
            this._x = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PointClass.prototype, "Y", {
        get: function () {
            return this._y;
        },
        set: function (value) {
            if (value < 0) {
                throw new Error("y的value不能小于0");
            }
            this._y = value;
        },
        enumerable: false,
        configurable: true
    });
    return PointClass;
}());
exports.PointClass = PointClass;
